%% This code reproduces Tables 5 (FF_6_Robust.csv), D6-D8.

clear;
for i = 1:5
FF = [1 3 4 5 6];

T0  = readtable('15min_B005.csv');
T1 = readtable('5min_B005.csv');
T2 = readtable('15min_B005_Post2003.csv');
T3  = readtable('15min_B01.csv');
T4 = readtable('15min_Alter_B005.csv');
T5 = readtable('15min_Cont.csv');



ind = [1,2,3,4,5,7,8,10,11,13,14,16,17,19];


if i == 5 % FF6

    TT  = table(T0.final9,T0.final10,T1.final9,T1.final10,T2.final9,T2.final10,T3.final9,T3.final10);
    TT.Var9(ind)=num2cell(T4.final9);
    TT.Var10(ind)=num2cell(T4.final10);

elseif i==4

    TT  = table(T0.final7,T0.final8,T1.final7,T1.final8,T2.final7,T2.final8,T3.final7,T3.final8);
    TT.Var9(ind)=num2cell(T4.final7);
    TT.Var10(ind)=num2cell(T4.final8);

elseif i==3

    TT  = table(T0.final5,T0.final6,T1.final5,T1.final6,T2.final5,T2.final6,T3.final5,T3.final6);
    TT.Var9(ind)=num2cell(T4.final5);
    TT.Var10(ind)=num2cell(T4.final6);

elseif i==2
  
    TT  = table(T0.final3,T0.final4,T1.final3,T1.final4,T2.final3,T2.final4,T3.final3,T3.final4);
    TT.Var9(ind)=num2cell(T4.final3);
    TT.Var10(ind)=num2cell(T4.final4);


else 

    TT  = table(T0.final1,T0.final2,T1.final1,T1.final2,T2.final1,T2.final2,T3.final1,T3.final2);
    TT.Var9(ind)=num2cell(T4.final1);
    TT.Var10(ind)=num2cell(T4.final2);

end

writetable(TT, ['FF_',num2str(FF(i)),'_Robust.csv']);
end